const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless:true,
  });
  const page = await browser.newPage();
  await page.goto('https://www.baidu.com', { waitUntil: 'networkidle2' });
  await page.pdf({ path: './public/hn.pdf', format: 'A4' });

  await browser.close();
})();